package com.evl.api.payOrder.controller;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.evl.common.persistence.dao.TrainTicketMapper;
import com.evl.config.properties.TravelticketsProperties;
import com.evl.core.vo.BaseResultVo;
import com.evl.trainOrder.service.ITrainOrderService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


@Controller
@RequestMapping("/payCallback")
@Api(value = "微信支付回调")
public class WxPayController{
	
	protected final static Logger log = Logger.getLogger(WxPayController.class);
	
	@Resource
	TravelticketsProperties properties;
	
	@Resource
	private ITrainOrderService iTrainOrderService;
	
    @RequestMapping(value = "/wxPayNotify", method = RequestMethod.POST)
    @ApiOperation(value="查询支付状态",httpMethod = "POST", response = BaseResultVo.class, notes = "更新支付状态")
    @ResponseBody
    public void postMessage(@RequestParam String orderNo)
    {
    	try {
			iTrainOrderService.refushOrderPayStatus(orderNo);
		} catch (Exception e) {
			e.printStackTrace();
		}
    }
}
